package springboot1706.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import springboot1706.bean.Goods;
import springboot1706.dao.GoodsMapper;
import springboot1706.service.GoodsService;

@Service
public class GoodsServiceImpl implements GoodsService{
	@Autowired
	private GoodsMapper goodsMapper;
	
	public List<Goods> getGoodById(Goods goods) {
		return goodsMapper.getGoodById(goods);
	}

	public List<Goods> getAll() {
		return goodsMapper.getAll();
	}

	public List<Goods> getGoodByName(String goods) {
		return goodsMapper.getGoodByName(goods);
	}

	public int delete(Goods goods) {
		return goodsMapper.delete(goods);
	}

	public int update(Goods goods) {
		return goodsMapper.update(goods);
	}

	public int insert(Goods goods) {
		return goodsMapper.insert(goods);
	}


	@Override
	public int updateStock(int id) {
		
		return goodsMapper.updateStock(id);
	}
	
}
